﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BingVis.Common;

namespace BingVis.GoogleTransit
{
    public static class FareStopLookup
    {        
        
        private static Dictionary<string, string> _lookup = new Dictionary<string, string>()
        {
            { "chestnut hills", "chestnut hill ave" },
            { "kendall square", "kendall/mit" },
            { "mass ave", "massachusetts ave." },
            { "south station", "south" },
            { "jfk/u mass", "jfk/umass" },
            { "charles mgh", "charles/mgh" },
            { "park street", "park st." },
            { "andrew square", "andrew sq" },
            { "copley square", "copley" },
            { "state street", "state st." },
            { "courthouse", "court house" },
            { "north station", "north" },
            { "n.e.medical center", "new england medical center" },
            { "kenmore square", "kenmore" },
            { "sullivan square", "sullivan" },
            { "goverment center", "government center" },
            { "heath", "heath st." },
            { "coolidge", "coolidge corner" },
            { "north eastern", "northeastern" },
            { "brigham", "brigham circle" },
            { "st. mary's", "saint mary st" },
        };

        public static string GetStopName(string stop)
        {
            var key = stop.Replace("\"", "").Replace("_", ",").Trim().ToLower();
            if (_lookup.ContainsKey(key))
                return _lookup[key];

            return key;
        }

        public static bool CompareStopNames(string stop1, string stop2)
        {
            return GetStopName(stop1).Equals(GetStopName(stop2), StringComparison.CurrentCultureIgnoreCase);
        }
    }

    
}
